package com.guigu.aggregation.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.guigu.aggregation.DTO.AppCourierQueryDTO;
import com.guigu.aggregation.DTO.work.TaskPickupDispatchDTO;
import com.guigu.aggregation.mapper.CourierMapper;
import com.guigu.aggregation.service.CourierService;
import com.guigu.tms.result.R;
import com.guigu.tms.result.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CourierServiceImpl implements CourierService {

    @Autowired
    private CourierMapper courierMapper;

    @Override
    public R<TaskPickupDispatchDTO> findByPage(AppCourierQueryDTO dto) {
        IPage<TaskPickupDispatchDTO> iPage = new Page();
        iPage.setSize(dto.getPageSize());
        iPage.setCurrent(dto.getPage());
        IPage<TaskPickupDispatchDTO> page = courierMapper.findByPage(iPage, dto);

        return new R(ResultCode.SUCCESS_CODE,"查询成功!",page);
    }
}
